package token;

import java.util.ArrayList;
import java.util.List;

public class StringTuple {

	private String value;
	private List<FileTuple> metadata;
	private boolean mark = false;
	
	
	public StringTuple() {
		this.metadata = new ArrayList<FileTuple>();
	}
	
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	public List<FileTuple> getMetadata() {
		return metadata;
	}
	public void setMetadata(List<FileTuple> metadata) {
		this.metadata = metadata;
	}
	
	public void addMetadata(FileTuple metadata) {
		this.metadata.add(metadata);
	}
	public void setMark() {
		this.mark = true;
	}
	public void setMarkFalse() {
		this.mark = false;
	}
	public boolean getMark() {
		return this.mark;
	}
	
	
	public String toString() {
		String output = "";
		output = output.concat("{\"");
		output = output.concat(this.value);
		output = output.concat("\"");
		for (FileTuple metadata : this.metadata) {
			output = output.concat("<'");
			output = output.concat(metadata.getFileName());
			output = output.concat("'");
			for (Integer index : metadata.getIndices()) {
				output = output.concat(", " + index.toString());
			}
			output = output.concat(">");
		}
		output = output.concat("}");
		return output;
		
	}


}
